Spot-On
spot-on-send.h
1 /*
2 ** Copyright (c) 2011 - 10^10^10, Alexis Megas.
3 ** All rights reserved.
4 **
5 ** Redistribution and use in source and binary forms, with or without
6 ** modification, are permitted provided that the following conditions
7 ** are met:
8 ** 1. Redistributions of source code must retain the above copyright
9 ** notice, this list of conditions and the following disclaimer.
10 ** 2. Redistributions in binary form must reproduce the above copyright
11 ** notice, this list of conditions and the following disclaimer in the
12 ** documentation and/or other materials provided with the distribution.
13 ** 3. The name of the author may not be used to endorse or promote products
14 ** derived from Spot-On without specific prior written permission.
15 **
16 ** SPOT-ON IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 ** SPOT-ON, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27 
28 #ifndef _spoton_send_h_
29 #define _spoton_send_h_
30 
31 #if QT_VERSION >= 0x050501 && defined(SPOTON_BLUETOOTH_ENABLED)
32 #include <QBluetoothAddress>
33 #endif
34 #include <QByteArray>
35 #include <QHostAddress>
36 
38 {
39  public:
40  enum spoton_send_method
41  {
42  ARTIFICIAL_GET = 0,
43  NORMAL_POST
44  };
45 
46  static QByteArray EOM;
47  static QByteArray message0000(const QByteArray &message);
48  static QByteArray message0000
49  (const QByteArray &message,
50  const spoton_send_method sendMethod,
51  const QPair<QByteArray, QByteArray> &adaptiveEchoPair);
52  static QByteArray message0000a(const QByteArray &message);
53  static QByteArray message0000a
54  (const QByteArray &message,
55  const spoton_send_method sendMethod,
56  const QPair<QByteArray, QByteArray> &adaptiveEchoPair);
57  static QByteArray message0000b(const QByteArray &message);
58  static QByteArray message0000b
59  (const QByteArray &message,
60  const spoton_send_method sendMethod,
61  const QPair<QByteArray, QByteArray> &adaptiveEchoPair);
62  static QByteArray message0000d(const QByteArray &message);
63  static QByteArray message0000d
64  (const QByteArray &message,
65  const spoton_send_method sendMethod,
66  const QPair<QByteArray, QByteArray> &adaptiveEchoPair);
67  static QByteArray message0001a
68  (const QByteArray &message,
69  const QPair<QByteArray, QByteArray> &adaptiveEchoPair);
70  static QByteArray message0001b(const QByteArray &message);
71  static QByteArray message0001b
72  (const QByteArray &message,
73  const QPair<QByteArray, QByteArray> &adaptiveEchoPair);
74  static QByteArray message0001c(const QByteArray &message);
75  static QByteArray message0001c
76  (const QByteArray &message,
77  const QPair<QByteArray, QByteArray> &adaptiveEchoPair);
78  static QByteArray message0002a
79  (const QByteArray &message,
80  const QPair<QByteArray, QByteArray> &adaptiveEchoPair);
81  static QByteArray message0002b
82  (const QByteArray &message,
83  const QPair<QByteArray, QByteArray> &adaptiveEchoPair);
84  static QByteArray message0011(const QByteArray &keyType,
85  const QByteArray &name,
86  const QByteArray &publicKey,
87  const QByteArray &signature,
88  const QByteArray &sPublicKey,
89  const QByteArray &sSignature);
90  static QByteArray message0012(const QByteArray &message);
91  static QByteArray message0013(const QByteArray &message);
92  static QByteArray message0013
93  (const QByteArray &message,
94  const QPair<QByteArray, QByteArray> &adaptiveEchoPair);
95  static QByteArray message0014(const QByteArray &message);
96  static QByteArray message0030(const QByteArray &message);
97 #if QT_VERSION >= 0x050501 && defined(SPOTON_BLUETOOTH_ENABLED)
98  static QByteArray message0030(const QBluetoothAddress &address,
99  const quint16 port,
100  const QString &orientation);
101 #endif
102  static QByteArray message0030(const QHostAddress &address,
103  const quint16 port,
104  const QString &transport,
105  const QString &orientation);
106  static QByteArray message0040a(const QByteArray &message);
107  static QByteArray message0040b(const QByteArray &message,
108  const spoton_send_method sendMethod);
109  static QByteArray message0050(const QByteArray &hash,
110  const QByteArray &salt);
111  static QByteArray message0051(const QByteArray &hash,
112  const QByteArray &salt);
113  static QByteArray message0052(void);
114  static QByteArray message0060
115  (const QByteArray &message,
116  const QPair<QByteArray, QByteArray> &adaptiveEchoPair);
117  static QByteArray message0065(const QByteArray &magnet);
118  static QByteArray message0070(const QByteArray &motd);
119  static QByteArray message0080
120  (const QByteArray &message,
121  const QPair<QByteArray, QByteArray> &adaptiveEchoPair);
122  static QByteArray message0090
123  (const QByteArray &message,
124  const QPair<QByteArray, QByteArray> &adaptiveEchoPair);
125  static QByteArray message0091a
126  (const QByteArray &message,
127  const QPair<QByteArray, QByteArray> &adaptiveEchoPair);
128  static QByteArray message0091b
129  (const QByteArray &message,
130  const QPair<QByteArray, QByteArray> &adaptiveEchoPair);
131  static QByteArray messageXYZ
132  (const QByteArray &message,
133  const QPair<QByteArray, QByteArray> &adaptiveEchoPair);
134 
135  private:
136  spoton_send(void);
137  static QByteArray adaptiveEchoAuthentication
138  (const QByteArray &message,
139  const QPair<QByteArray, QByteArray> &adaptiveEchoPair);
140 };
141 
142 #endif
Definition: spot-on-send.h:37